using static SmartSite.Common.CheckingNullArgument;

namespace SmartSite.Frame
{
    public class FrameTypeField : ULongField, IValueField<FrameTypeEnum>
    {
        public FrameTypeField(IBytesBuffer buffer, BitUnit index)
            : base(buffer, index, 5) { }

        public FrameTypeField(IField field)
            : this(field, CheckingNull(field, nameof(field)).EndIndex) { }

        public new FrameTypeEnum Value
        {
            get => (FrameTypeEnum)base.Value;
            set => base.Value = (ulong)value;
        }
    }
}